/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package service.reportCenter.tankScheduling;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@XmlRootElement(name="tankSchedule")
@XmlAccessorType(XmlAccessType.FIELD)
public class TankSchedule {
    private int index;
    private String tankDesg;
    private int tankID;
    private List<TankBrews> brews;
    private boolean secondaryTank;

    public TankSchedule() {
    }

    public TankSchedule(int index, String tankDesg, int tankID, List<TankBrews> brews, boolean secondaryTank) {
        this.index = index;
        this.tankDesg = tankDesg;
        this.brews = brews;
        this.tankID = tankID;
        this.secondaryTank = secondaryTank;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getTankDesg() {
        return tankDesg;
    }

    public void setTankDesg(String tankDesg) {
        this.tankDesg = tankDesg;
    }

    public List<TankBrews> getBrews() {
        return brews;
    }

    public void setBrews(List<TankBrews> brews) {
        this.brews = brews;
    }

    public int getTankID() {
        return tankID;
    }

    public void setTankID(int tankID) {
        this.tankID = tankID;
    }

    public boolean isSecondaryTank() {
        return secondaryTank;
    }

    public void setSecondaryTank(boolean secondaryTank) {
        this.secondaryTank = secondaryTank;
    }
    
    public void addTankBrew(final TankBrews tankBrew){
        if(this.getBrews()==null){
            List<TankBrews> newBrews = new ArrayList<TankBrews>();
            newBrews.add(tankBrew);
            this.setBrews(newBrews);
        } else {
            this.getBrews().add(tankBrew);
        }
    }
}
